package link.xieyu.wechat.entity;

import link.xieyu.pojo.BadRequestException;
import lombok.AllArgsConstructor;
import lombok.Getter;

import java.util.Arrays;

@Getter
@AllArgsConstructor
public enum EventTypeEnums {
    /**
     * 取消关注
     */
    UNSUBSCRIBE("unsubscribe", "退订"),
    SUBSCRIBE("subscribe", "关注"),
    CLICK("CLICK", "点击"),
    DEFAULT("DEFAULT","默认")
    ;
    private final String eventTest;
    private final String eventContext;

    public static EventTypeEnums find(String eventTest) {
        for (EventTypeEnums value : EventTypeEnums.values()) {
            if (value.getEventTest().equals(eventTest)) {
                return value;
            }
        }
        return DEFAULT;
    }

}
